Automated vehicle counting is an important tool that is widely used by traffic planners. It helps local governments determine critical traffic flow time periods, maintenance schedules and optimal traffic enforcement time periods. It also aids incident detection, verification and response. Recently, retailers have also expressed interest in automated vehicle counting solutions which will help them determine the factors that influence traffic through stores; for example, a restaurant chain or retail store with a video-based vehicle-counting solution. Traditionally, vehicle counting has been performed by using on-road devices, i.e. roadway sensors, such as pressure hoses and induction coils, but these are typically inaccurate and may be expensive to deploy and maintain. Video-based vehicle counting utilizes existing and ever-expanding camera networks aimed at traffic law enforcement and surveillance applications, but it is typically performed offline and is computationally expensive. What is needed is a method to perform vehicle counting on the compressed video stream associated with many existing video/image capturing systems and/or to seamlessly integrate vehicle counting into the compression process itself.